<template>
    <div class="mui-numbox" data-numbox-step='1' data-numbox-min='1' data-numbox-max='100'>
        <button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
        <input @change="countChange" class="mui-numbox-input" type="number" :value="$store.getters.goodsCount[num]" ref="count" />
        <button class="mui-btn mui-numbox-btn-plus" type="button">+</button>
    </div>
</template>
<script>
import mui from "../../../node_modules/mui/js/mui";
export default {
    props:['num'],
    mounted() {
        mui(".mui-numbox").numbox();
        
    },
    methods: {
        countChange(){
            this.$store.commit("updateGoodsInfo",{
                id:this.num,
                count:this.$refs.count.value
            })
        }
    }
}
</script>
<style lang="scss" scoped>

</style>
